-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Change unsteady timestep using Python wrapper #2190
[WIP] Change unsteady timestep using Python wrapper #2190
Conversation
Changed to WIP, found several areas that presume a constant timestep in calculation of time I hadn't considered, like: SU2/SU2_CFD/src/drivers/CSinglezoneDriver.cpp Lines 117 to 118 in 2c9fbb6
and SU2/SU2_CFD/src/solvers/CMeshSolver.cpp Lines 984 to 991 in 2c9fbb6
I am sure there are many others, so this probably is not as straightforward as I had thought. |
@bigfooted Has there ever been any discussion regarding implementation of a It can maybe look something like:
Then |
Sounds good to implement START_TIME for the restart issue. But for what you want to do it would be better to just accumulate the dts to compute physical time |
Includes a getter method in CConfig
Just want to leave some notes here, open to any thoughts or suggestions. I think it's best to have it work something like this for 1st-order dual timestepping:
Then if I want to restart that simulation but with a different timestep, I would have to make sure
I think it may make more sense to just call it However I don't think that this adaptive timestepping functionality / changing of timesteps for unsteady restarts would work for 2nd-order dual timestepping since information on the previous dt is lost. It wouldn't be too challenging to have a check for this in |
Closing this for now unfortunately - I will not have the time in the immediate future to work through intricacies of this. There are too many other features of SU2 that presume a dt*time_iter as the present physical time, so implementing this in a general way that accounts for these is a bit more tedious than I had expected. |
Proposed Changes
I have found it useful to be able to adaptively change deltaT using the Python wrapper -- this PR implements that functionality.
Instead of
CDriver::GetUnsteadyTimeStep
returningCConfig::GetTime_Step
, it was updated to return the actual dimensional timestep used in iterations. A newCDriver::SetUnsteadyTimeStep
function was implemented that updates bothDelta_UnstTimeND
andDelta_UnstTime
inCConfig
. A new setter function forDelta_UnstTime
had to be implemented to do this as well.A quick grep showed me that the only usage of
CConfig::GetTime_Step
appears to be in SU2_SOL, initialization, and outputting in the NonDimTable. However, I did see one usage of it here, which appears to be called every iteration:SU2/SU2_CFD/src/integration/CFEM_DG_Integration.cpp
Line 75 in 2c9fbb6
I can update that line if necessary to instead call
CConfig::GetDelta_UnstTime
. I don't believe that there are any additional issues that may be arisen beyond this.Related Work
N/A
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.
pre-commit run --all
to format old commits.